package controller

import (
	"github.com/kataras/iris"
	"github.com/kataras/iris/mvc"
	"wow-web/config"
)

type WowController struct {
	Ctx iris.Context
}

func (*WowController) GetRegister() mvc.Result {
	return mvc.View{
		Name: "index.html",
		Data: iris.Map{"Realm": config.GetConfig().Realm},
	}
}
func (*WowController) Get() mvc.Result {
	return mvc.View{
		Name: "index.html",
		Data: iris.Map{"Realm": config.GetConfig().Realm},
	}
}
func (c *WowController) GetSuccess() mvc.Result {
	account := c.Ctx.URLParamDefault("account", "")
	return mvc.View{
		Name: "success.html",
		Data: iris.Map{
			"Title":   "账号注册成功",
			"Message": "账号 " + account + " 注册成功, 参考以下说明进入游戏!",
			"Realm":   config.GetConfig().Realm,
		},
	}
}
func (c *WowController) GetEmail() mvc.Result {
	mail := c.Ctx.URLParamDefault("mail", "")
	return mvc.View{
		Name: "success.html",
		Data: iris.Map{
			"Title":   "注册信息已经提交成功",
			"Message": "注册信息已经提交成功, 请至邮箱 " + mail + " 检查激活邮件!",
			"Realm":   config.GetConfig().Realm,
		},
	}
}
